﻿<ButtonBase x:Class="Flare.Controls.MenuButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="200" d:DesignWidth="200" ClickMode="Press" Margin="8">

    <Border Style="{StaticResource StyleBorderZoomed}" Background="Transparent" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
        <Viewbox Stretch="Uniform" StretchDirection="DownOnly" ScrollViewer.VerticalScrollBarVisibility="Disabled" UseLayoutRounding="True">
            <DockPanel LastChildFill="False" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                <Image Stretch="Uniform" DockPanel.Dock="Top"
                   Source="{Binding ICOSource, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ButtonBase}}}" />
                <TextBlock DockPanel.Dock="Top" Text="{Binding Header, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ButtonBase}}, FallbackValue=NaN}" 
                           HorizontalAlignment="Center" VerticalAlignment="Bottom" Foreground="{DynamicResource ColorText}" FontSize="20"/>
            </DockPanel>
        </Viewbox>
    </Border>
</ButtonBase>
